<?php
/**
 * @version		$Id: index.php WaseemSadiq $
 * @package		Joomla
 * @subpackage	Templates / basic skeleton template
 * @copyright	Copyright (C) 2005 - 2007 Open Source Matters. All rights reserved.
 * @license		GNU/GPL, see LICENSE.php
 * Joomla! is free software. This version may have been modified pursuant to the
 * GNU General Public License, and as distributed it includes or is derivative
 * of works licensed under the GNU General Public License or other free or open
 * source software licenses. See COPYRIGHT.php for copyright notices and
 * details.
 */

/* Prevent direct access
 * Help: http://joomlaworkshop.com/docs/basic/4
	*/
defined('_JEXEC') or die('Restricted access');

/* PHP Includes
 * Help: http://joomlaworkshop.com/docs/basic/5
	*/
include_once("includes/template_config.php");

/* JURI::getInstance
 * Help: http://joomlaworkshop.com/docs/intermediate/6
	*/
$url = clone(JURI::getInstance());

/* JFactory::getUser
 * Help: http://joomlaworkshop.com/docs/intermediate/8
	*/
$user =& JFactory::getUser();
?>

<?php echo '<?xml version="1.0" encoding="utf-8"?' .'>'; ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $this->language; ?>" lang="<?php echo $this->language; ?>" dir="<?php echo $this->direction; ?>" >

<head>

<!-- jdoc:include
     Help: http://joomlaworkshop.com/docs/basic/9
     -->
	<jdoc:include type="head" />
  
<!-- Behavior Mootools
     Help: http://joomlaworkshop.com/docs/basic/15
     -->  
	<?php JHTML::_('behavior.mootools'); ?>

<!-- Prevent SmartTags 
					Help:	http://joomlaworkshop.com/docs/basic/16
     -->
	<meta name="mssmarttagspreventparsing" content="true" />
<!-- Disable Image Toolbar
					Help:	http://joomlaworkshop.com/docs/basic/17
 	   -->
 <meta http-equiv="imagetoolbar" content="no" />
  
<!-- Linking Stylesheets
     Help: http://joomlaworkshop.com/docs/basic/18
     -->    
	<link href="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/css/<?php echo $this->params->get('widthStyle'); ?>.css" rel="stylesheet" type="text/css" media="screen" />
	<link href="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/css/template.css" rel="stylesheet" type="text/css" media="screen" />
  
<!-- Alternate Stylesheets
     Help: http://joomlaworkshop.com/docs/intermediate
     -->    	
	<link rel="alternate stylesheet" type="text/css" href="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/css/narrow.css" title="narrow" media="screen" />
	<link rel="alternate stylesheet" type="text/css" href="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/css/wide.css" title="wide" media="screen" />

<!-- Style Switcher
     Help: http://joomlaworkshop.com/docs/advanced
     -->  
	<?php if ($this->params->get('styleSwitch') == 1): ?>
		<script type="text/javascript" src="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/javascript/styleswitch.js"></script>
	<?php endif; ?>
  
<!-- Conditional Stylesheets
     Help: http://joomlaworkshop.com/docs/
     -->    
	<!--[if lt IE 7]>
		<style type="text/css"> img { behavior: url(<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/css/iepngfix.htc); }</style>
		<link rel="stylesheet" type="text/css" href="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/css/ie_hacks.css" media="screen, projection" />
		<script type="text/javascript" src="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/javascript/iehover.js"></script>
	<![endif]-->	
	<!--[if IE 7]>
		<link rel="stylesheet" type="text/css" href="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/css/ie_7.css" media="screen, projection" />
	<![endif]-->
	<?php if($this->direction == 'rtl') : ?><link href="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/css/rtl/layout_rtl.css" rel="stylesheet" type="text/css" /><?php endif; ?>
  
<!-- SmoothScroll
     Help: http://joomlaworkshop.com/docs/basic/15 -->    
	<script type="text/javascript">
 	window.onDomReady(function(){ new SmoothScroll({duration: 1200}); });
	</script>
</head>

<!-- Body Style
     Help: http://joomlaworkshop.com/docs/
     -->  

<body id="<?php echo $style ;?>" class="joomla">
	<div id="container">
    
<!-- Access links
    	Help: http://joomlaworkshop.com/docs/
     -->      
  <a id="top" name="top"></a>
       
  <ul id="access">
   <li><a href="<?php $url->setFragment('content'); echo $url->toString();?>" class="to-content">Content</a></li>
    
   <?php if ($this->countModules('user3')) : ?>
    <li><a href="<?php $url->setFragment('mainmenu'); echo $url->toString();?>" class="to-nav">Navigation</a></li>
   <?php endif; ?>
    
   <?php if($this->countModules('user6 or user7 or user8 or user9')) : ?>
    <li><a href="<?php $url->setFragment('additional'); echo $url->toString();?>" class="to-additional">Additional Information</a></li>
   <?php endif; ?>
    
   <?php if ($this->params->get('styleSwitch') == 1): ?>
    <li class="narrow"><a href="#" onclick="styleswitch('set', 'narrow'); return false;">narrow</a></li>
    <li class="wide"><a href="#" onclick="styleswitch('set', 'wide'); return false;">wide</a></li>
   <?php endif; ?>		
  </ul>
     
  <div id="header" class="clr clearfix">        
   <div id="branding">
   
<!-- JFactory::getUser
  			Help: http://joomlaworkshop.com/docs/intermediate/8
	   	-->
    <?php if ($user->get('guest')) : ?>
               
<!-- Adding a logo
    	Help: http://joomlaworkshop.com/docs/beginner/adding-a-logo
     -->             
     <h1><a href="<?php echo $this->baseurl ?>/index.php" title="<?php echo $mainframe->getCfg('sitename');?>"><?php echo $mainframe->getCfg('sitename');?></a></h1>
     
     <?php else : ?>
       <p>
        Hello <?php echo $user->get('name');?><br />
        Your email address is: <?php echo $user->get('email');?> click <a href="<?php echo $this->baseurl ?>/index.php?option=com_user&amp;view=user&amp;task=edit#email" title="User details page">here</a> to change it<br />
        You are a: <?php echo $user->get('usertype');?> user<br />
        You registered on: <?php echo $user->get('registerDate');?><br />
        You last visited the site on: <?php echo $user->get('lastvisitDate');?>
       </p>
    
    <?php endif; ?>
   </div><!-- end branding -->
             
   <?php if ($this->countModules('top')) : ?>
    <div id="top-module">
     <jdoc:include type="module" name="top" style="xhtml" />
    </div><!-- end top-module -->
   <?php endif; ?>            
  </div><!-- end header -->
             
  <div id="breadcrumbs">
   <p>You are here: <jdoc:include type="module" name="breadcrumbs" /></p>
  </div><!-- end breadcrumbs -->
             
   <?php if ($this->countModules('user3')) : ?>
    <a id="mainmenu" name="mainmenu"></a>
    <div id="nav" class="clr">
     <jdoc:include type="modules" name="user3" style="raw" /> 
    </div><!-- end nav -->
   <?php endif; ?>
         
  <div id="body-content" class="clr clearfix">
   <div id="load-first" class="clearfix">				
    
    <div id="middle-column">
     <div class="inside">						
      
      <?php if ($this->countModules('user1 or user2 or user4 or user5')) : ?>
       <div id="top-user-modules" class="clearfix">
       
        <?php if ($this->countModules('user1')) : ?>
         <div id="user1" class="count<?php echo $top_total ;?>">
          <div class="inside">
           <jdoc:include type="modules" name="user1" style="xhtml" />
          </div><!-- end inside -->
         </div><!-- end user1 -->
        <?php endif; ?>
        
        <?php if ($this->countModules('user2')) : ?>
         <div id="user2" class="count<?php echo $top_total ;?>">
          <div class="inside">
           <jdoc:include type="modules" name="user2" style="xhtml" />
          </div><!-- end inside -->
         </div><!-- end user2 -->
        <?php endif; ?>
        
        <?php if ($this->countModules('user4')) : ?>
         <div id="user4" class="count<?php echo $top_total ;?>">
          <div class="inside">
           <jdoc:include type="modules" name="user4" style="xhtml" />
          </div><!-- end inside -->
         </div><!-- end user4 -->
        <?php endif; ?>
        
        <?php if ($this->countModules('user5')) : ?>
         <div id="user5" class="count<?php echo $top_total ;?>">
          <div class="inside">
           <jdoc:include type="modules" name="user5" style="xhtml" />
          </div><!-- end inside -->
         </div><!-- end user5 -->
        <?php endif; ?>
                      
       </div><!-- end top-user-modules -->
      <?php endif; ?>
              
      <a id="content" name="content"></a>
      <div id="main-body">
       
       <?php if ($this->getBuffer('message')) : ?>
        <div class="error">
         <h2> Message </h2>
         <jdoc:include type="message" />
        </div>
       <?php endif; ?>
       
       <jdoc:include type="component" />
      </div><!-- end main-body -->
              
      <?php if ($this->countModules('user6 or user7 or user8 or user9')) : ?>
       <a id="additional" name="additional"></a>
       <div id="bottom-user-modules" class="clearfix">
       
        <?php if ($this->countModules('user6')) : ?>
         <div id="user6" class="count<?php echo $bottom_total ;?>">
          <div class="inside">
           <jdoc:include type="modules" name="user6" style="xhtml" />
          </div><!-- end inside -->
         </div><!-- end user6 -->
        <?php endif; ?>
        
        <?php if ($this->countModules('user7')) : ?>
         <div id="user7" class="count<?php echo $bottom_total ;?>">
          <div class="inside">
           <jdoc:include type="modules" name="user7" style="xhtml" />
          </div><!-- end inside -->
         </div><!-- end user7 -->
        <?php endif; ?>
        
        <?php if ($this->countModules('user8')) : ?>
         <div id="user8" class="count<?php echo $bottom_total ;?>">
          <div class="inside">
           <jdoc:include type="modules" name="user8" style="xhtml" />
          </div><!-- end inside -->
         </div><!-- end user8 -->
        <?php endif; ?>
        
        <?php if ($this->countModules('user9')) : ?>
         <div id="user9" class="count<?php echo $bottom_total ;?>">
          <div class="inside">
           <jdoc:include type="modules" name="user9" style="xhtml" />
          </div><!-- end inside -->
         </div><!-- end user9 -->
        <?php endif; ?>
       
       </div><!-- end bottom-user-modules -->
      <?php endif; ?>
     
     </div><!-- end inside -->
    </div><!-- end middle-column -->
  
    <?php if ($this->countModules('left or syndicate')) : ?>
     <div id="left">
      <div class="inside">
       <?php if ($this->countModules('left')) : ?>
        <jdoc:include type="modules" name="left" style="xhtml" />
       <?php endif; ?>   
       <?php if ($this->countModules('syndicate')) : ?>
        <jdoc:include type="modules" name="syndicate" style="xhtml" />
       <?php endif; ?>
      </div><!-- end inside -->
     </div><!-- end left -->
    <?php endif; ?>
   </div><!-- end load-first -->					
  
   <?php if($this->countModules('right') and JRequest::getCmd('layout') != 'form') : ?>
    <div id="right">
     <div class="inside">
      <jdoc:include type="modules" name="right" style="xhtml" />
     </div><!-- end inside -->
    </div><!-- end right -->
   <?php endif; ?>
 
   </div><!-- end body-content -->         
         
  <div id="footer" class="clearfix">
   <?php if ($this->countModules('footer')) : ?>
    <div class="inside">
     <jdoc:include type="modules" name="footer" style="xhtml" />
    </div><!-- end inside -->
   <?php endif; ?>
  </div><!-- end footer -->
 
  <!-- Back to top link -->
  <div id="backtotoplink">
   <a href="<?php $url->setFragment('top'); echo $url->toString();?>" class="to-additional">Back to Top</a>
  </div>
        
	</div><!-- end container -->
    
<?php if ($this->countModules('debug')) : ?>
	<div id="debug">
 	<jdoc:include type="modules" name="debug" />
 </div>
<?php endif; ?>
    
</body>
</html>